//
//  SHLocationServicesManager.h
//  SHLocationServices
//
//  Created by suoxiaoxiao on 2019/6/26.
//

#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef void(^LocalCoordinateResultSuccessBlock)(NSString *country,NSString *province,NSString *city,NSString *area,NSString *street,NSString *address,CLLocation *newLocation);
typedef void(^LocalResultErrorBlock)(NSError *error);


typedef NS_ENUM(NSInteger, SHLocationServicesErrorCode) {
    SHLocationServicesErrorCodeAuthorizationDenied = 400,//权限受限
    SHLocationServicesErrorCodeGeocoderError,            //反地理编码错误
    SHLocationServicesErrorCodeUnknown                   //未知错误
};


@interface SHLocationServicesManager : NSObject

/**
 原生定位和逆地理编码(参数添加坐标)

 @param resultBlock 成功回调
 @param errorBlock  失败回调
 */
+ (void)startCoordinateLocalSuccess:(LocalCoordinateResultSuccessBlock)resultBlock fail:(LocalResultErrorBlock)errorBlock;

/**
 停止原生定位服务
 */
+ (void)stopLocal;


@end

NS_ASSUME_NONNULL_END
